using System;
using Framework.Library.Base.Base;

namespace Framework.Portal.Layouts.Admin.Components.Database
{
    public partial class ViewsAction : BaseControl
    {
        //_View objView = new _View();
        protected void Page_Load(object sender, EventArgs e)
        {
            //if ((!CurrentUser.IsSuperAdmin && CommandController.IsSystemModule(AdminPage.CurrentCommand.CommandID)) || !CommandController.IsAvailableForUser(AdminPage.CurrentCommand.CommandID, CurrentUser.UserID, Convert.ToInt32(Config.Portal)))
            //    Response.Redirect(Config.ADMIN_CMD, true);
            //if (!IsPostBack)
            //{
            //    //switch on action
            //    switch (Request.QueryString["action"].ToString())
            //    {
            //        case "drop":
            //            loadDropForm();
            //            break;
            //    }
            //    lblCommandName.Text = MENUNAME;
            //    lnkViewList.NavigateUrl = MiscUtility.AdminUrlParams(CommandController.GetCommandbyID((int)PortalControls.View));
            //    lnkViewDetails.NavigateUrl = MiscUtility.AdminUrlParams(CommandController.GetCommandbyID((int)PortalControls.ViewProperty)) + "&id=" + Request.QueryString["id"].ToString();
            //}
        }

        #region "Drop"

        //private void loadDropForm()
        //{   
        //    //Load Default properties
        //    objView.ID = Convert.ToInt64(Request["id"]);
        //    objView.LoadProperties();
        //    lblDropViewName.Text = objView.Owner + "." + objView.Name;
        //}

        protected void btnDrop_Click(object sender, EventArgs e)
        {
            //try
            //{
            //    //Load view properties
            //    objView.ID = Convert.ToInt64(Request["id"]);
            //    objView.LoadProperties();
            //    //Drop view
            //    objView.Drop();
            //    Response.Redirect(MiscUtility.AdminUrlParams(CommandController.GetCommandbyID((int)PortalControls.View)));
            //}
            //catch (Exception ex)
            //{
            //    lblError.Visible = true;
            //    lblError.Text = "<p>" + ex.Message + "</p>";
            //}
        }

        #endregion
    }
}